import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 设备台账信息 */
export interface DevInfo {
          devid: string; // 设备编码
          devname: string; // 设备名称
          devposition: string; // 1
          devtype: string; // 1
          jdl: string; // jdl
          note: string; // 1
          time: string; // 1
          remark: string; // 备注
  }

// 设备台账 API
export const DevInfoApi = {
  // 查询设备台账分页
  getDevInfoPage: async (params: any) => {
    return await request.get({ url: `/business/dev-info/page`, params })
  },

  // 查询设备台账详情
  getDevInfo: async (id: number) => {
    return await request.get({ url: `/business/dev-info/get?id=` + id })
  },

  // 新增设备台账
  createDevInfo: async (data: DevInfo) => {
    return await request.post({ url: `/business/dev-info/create`, data })
  },

  // 修改设备台账
  updateDevInfo: async (data: DevInfo) => {
    return await request.put({ url: `/business/dev-info/update`, data })
  },

  // 删除设备台账
  deleteDevInfo: async (id: number) => {
    return await request.delete({ url: `/business/dev-info/delete?id=` + id })
  },

  /** 批量删除设备台账 */
  deleteDevInfoList: async (ids: number[]) => {
    return await request.delete({ url: `/business/dev-info/delete-list?ids=${ids.join(',')}` })
  },

  // 导出设备台账 Excel
  exportDevInfo: async (params) => {
    return await request.download({ url: `/business/dev-info/export-excel`, params })
  }
}